﻿// Copyright (c) Vitaly Kamiansky. All rights reserved. 
// See License.txt in the project root.

using System;

namespace Property.Workers
{
    public partial class FunctionWorkerPrototype<T> : IFunctionWorkerPrototype<T>
    {
        public FunctionWorkerPrototype(IWorkerPrototype workerPrototype)
        {
            _WorkerPrototype = workerPrototype;
        }

        //=//

        private readonly IWorkerPrototype _WorkerPrototype;

        public IWorker Create(Func<T> getValue)
        {
            return new WorkerInstance(_WorkerPrototype, getValue);
        }
    }
}
